import axios from  './axios'
import qs from 'qs'

export  const reqLogin = (params) => {/*管理员登录*/
    return axios({
        method:'post',
        url:'/admin/login',
        data:params
    })
}

export const reqGetrepairlist = () =>{/*获取报修列表*/
    return axios({
        method:'get',
        url:'/admin/get_repair_list'
    })
}
export const reqRepair = (params) =>{/*修改报修状态*/
    return axios({
        method:'put',
        url:'/wx/repair',
        params:params
    })
}
export const reqAddAdmin = (params) =>{/*添加管理员*/
    return axios({
        method:'post',
        url:'/admin',
        params:params
    })
}

export const reqRepairType  = () =>{/*查看所有报修种类*/
    return axios({
        method:'get',
        url:'/admin/repair_type'
    })
}

export const reqCostType = () =>{/*查看所有缴费种类*/
    return axios({
        method:'get',
        url:'/admin/cost_type'
    })
}

export const reqGetUsers = () =>{/*获取用户列表*/
    return axios({
        method:'get',
        url:'/admin/users'
    })
}
export const reqAddrepqirType = (params) =>{/*添加报修种类*/
    return axios({
        method:'post',
        url:'/admin/repair_type',
        params:params
    })
}

export const reqAddCostType = (params) =>{/*添加缴费种类*/
    return axios({
        method:'post',
        url:'/admin/cost_type',
        params:params
    })
}

export const reqDeleRepair = (params) =>{/*删除报销种类*/
    return axios({
        method:'delete',
        url:'/admin/repair_type',
        params:params
    })
}

export const reqDeleCost = (params) =>{/*删除缴费种类*/
    return axios({
        method:'delete',
        url:'/admin/cost_type',
        params:params
    })
}

export const reqGetNews = () =>{/*获取所有新闻 */
    return axios({
        method:'get',
        url:'/wx/repair/news'
    })
}

export const reqAddNews = (params) =>{/*添加新闻*/
    return	axios({
        method:'post',
        url:'/admin/news',
        params:params
    })
}

export const reqDeleNews = (params) =>{/*添加新闻*/
    return	axios({
        method:'delete',
        url:'/admin/news',
        params:params
    })
}
/******************************* */
export const reqGetInventory = () =>{/*下载库存信息excel */
    return axios({
        method:'get',
        url:'/admin/exportExcel',
        responseType:'blob'
    })
}

export const reqAdmincheckValue = () =>{/*管理员查看已过审核列表*/
    return axios({
        method:'get',
        url:'/admin/browseWarehousingApplication',
    })
}

export const reqAdminVerify = (params) =>{/* 管理员分配入库地址 */
    return axios({
        method:'post',
        url:'/admin/Verify',
        data:params
    })
}

export const reqAdmincheckOut = () =>{/* 管理员查看待审出库列表*/
    return axios({
        method:'get',
        url:'/delivery/browse',
    })

}

export const reqAdminoutVerify = (params) =>{/*管理员审核商品出库 */
    return axios({
        method:'post',
        url:'/admin/adminVerify',
        params:params
    })
}

export const reqSelectOverdue = () =>{/*管理员查询超期物品*/
    return axios({
        method:'get',
        url:'/admin/selectOverdue'
    })
}

export const reqAdminExtension = (params) =>{/*管理员延期 */
    return axios({
        method:'post',
        url:'/admin/extension',
        params:params
    })
}
export const reqAdminRuRefuse = (params) =>{/*管理员入库拒绝*/
    return axios({
        method:'get',
        url:'/goods/adminRefuse',
        params:params
    })
}
export const reqAdminChuRefuse = (params) =>{/*管理员出库拒绝 */
    return axios({
        method:'post',
        url:'/delivery/adminRefuse',
        params:params
    })
}
export const reqAdmingetAllMessage = () =>{/*管理员查看所有库存信息 */
    return axios({
        method:'get',
        url:'/goods/selectAllGoods',
    })
}
export const reqBreakAllMessage = async function (params) {//管理员修改 单一物品信息
    let resp 
    await axios({
        method:'post',
        url:'/goods/updateGoods',
        params:params
    }).then(res =>{
        resp = res
    })
    return resp
}
export const reqRemoveState = async function (params) {//管理员更改物品暂存状态
    let resp = await axios({
        method:'post',
        url:'/goods/updateAccessControl',
        params:params
    })
    return resp
}
export const reqCheckAllCollege = async function (params) {//查看所有学院
    let resp = await axios({
        method:'get',
        url:'/goods/selectCollege',
        params:params
    })
    return resp
}
export const reqRemovePerson = async function (params) {//管理员更改负责人
    let resp = await axios({
        method:'post',
        url:'/goods/updateCharge',
        params:params
    })
    return resp
}
export const reqAddMemberList = async function (params) {//管理员添加信息
    let resp = await axios({
        method:'post',
        url:'/admin/addGoods',
        data:params
    })
    return resp
}
export const reqDeleteMemberList = async function (params) {//管理员删除信息
    let resp = await axios({
        method:'get',
        url:'/admin/deleteGoods',
        params:params
    })
    return resp
}

